package com.taffywen.study.spring_cloud_learn.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.HandlerInterceptor;

/**
 * 用于拦截请求，在请求处理的不同阶段加入自定义逻辑
 */
@Slf4j
public class DemoInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        log.info("进入到DemoInterceptor-----");
        return HandlerInterceptor.super.preHandle(request, response, handler);
    }
}
